<?php
/**
 * @Author: xuzhiyi
 * @Date:   2016-02-11 20:49:55
 * @Last Modified by:   xuzhiyi
 * @Last Modified time: 2016-02-27 11:51:01
 * ------------------------------------------------ *
 * 管理员登录日志 *
 * ------------------------------------------------ */ 

namespace Admin\Controller;

 class LogManagerLoginsController extends CommonController {

 	public function index(){
 		//格式化日期
 		list($start,$end)=explode('-',str_replace(' ','',I('dr')));
 		$start=str_replace('/','-',trim($start)).' 00:00:00';
 		$end=str_replace('/','-',trim($end)).' 23:59:59';
 		$where='a.loginTime between "'.$start.'" and "'.$end.'"';
 		if(IS_AJAX){
		$log = M('log_manager_logins')->join('as a left join '.C("DB_PREFIX").'managers as b on a.managerId=b.managerId')->field('a.*,b.loginName,managerName')->where($where)->order('loginTime desc')->select();
	 		$output['data']=$log;
			$this->ajaxReturn($output);
 		}
 		$this->display();
 	}
 }